﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SchoolManagementSystem
{
    public partial class Mutasi : Form
    {
        public Mutasi()
        {
            InitializeComponent();
        }

        public Mutasi(string id, string name)
        {
            InitializeComponent();
            txtID.Text = id;
            txtName.Text = name;
        }

        public DateTime MutationDate
        {
            get { return dtpDate.Value; }
        }

        public string Reason
        {
            get { return txtReason.Text; }
        }

        private void Mutasi_Load(object sender, EventArgs e)
        {

        }

        private void btnBatal_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void btnSimpan_Click(object sender, EventArgs e)
        {
            if (txtReason.Text.Length == 0)
            {
                MessageBox.Show("Mohon isi alasan mutasi", "Peringatan!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
                return;
            }

            DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
